import { SoStripUtil } from '../../../src/utils/so-strip-util.js';
import { DebugSymbol } from '../../../src/options/build/build-opt.js';

test('needStripUtil', () => {
  let debugSymbol: DebugSymbol | undefined = undefined;
  // 不填写默认为true
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(true);
  // 不填写strip，填写exclude,为true
  debugSymbol = {
    exclude: ['**/*.so'],
  };
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(true);
  // 不填写strip，不填写exclude，为true
  debugSymbol = {};
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(true);
  // 填写strip为true，填写exclude，为true
  debugSymbol = {
    strip: true,
    exclude: ['**/*.so'],
  };
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(true);
  // 填写strip为true，不填写exclude，为true
  debugSymbol = {
    strip: true,
  };
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(true);
  // 填写strip为false，填写exclude，为true
  debugSymbol = {
    strip: false,
    exclude: ['**/*.so'],
  };
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(true);
  // 填写strip为false，不填写exclude，为false
  debugSymbol = {
    strip: false,
  };
  expect(SoStripUtil.needStrip(debugSymbol)).toEqual(false);
});
